package com.lovo.psc.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
@TableName("psc_orderproduct")
@NoArgsConstructor
@ApiModel(value = "供货商品实体类",description = "供货商品实体类")
public class OrderProductBean {
    /**供货商品id*/
    @TableId(value = "pk_opId",type = IdType.AUTO)
    @ApiModelProperty(value = "供货商品id")
    private long opId;
    /**供货批次主键*/
    @TableField("fk_orderInfoId")
    @ApiModelProperty(value = "供货批次主键")
    private String orderInfoId;
    @TableField("op_productName")
    @ApiModelProperty(value = "商品名")
    private String productName;
    @TableField("op_type")
    @ApiModelProperty(value = "商品类型")
    private String type;
    @TableField("op_num")
    @ApiModelProperty(value = "供货数量")
    private int num;
    @TableField("op_buyPrice")
    @ApiModelProperty(value = "报价")
    private float buyPrice;
    @TableField("op_totalPrice")
    @ApiModelProperty(value = "单项报价")
    private float totalPrice;
    @TableField(exist = false)
    @ApiModelProperty("供货商品明细集合")
    private List<SupplyInfoBean> infoBeans;

    @TableField("fk_ooId")
    private long ooId;

    public OrderProductBean(String orderInfoId, String productName, String type, int num, float buyPrice, float totalPrice,long ooId) {
        this.orderInfoId = orderInfoId;
        this.productName = productName;
        this.type = type;
        this.num = num;
        this.buyPrice = buyPrice;
        this.totalPrice = totalPrice;
        this.ooId = ooId;
    }

    @Override
    public String toString() {
        return "OrderProductBean{" +
                "opId=" + opId +
                ", orderInfoId=" + orderInfoId +
                ", productName='" + productName + '\'' +
                ", type='" + type + '\'' +
                ", num=" + num +
                ", buyPrice=" + buyPrice +
                ", totalPrice=" + totalPrice +
                '}';
    }
}
